package model;

import connection.DbConnection;
import bean.Poll;
import bean.PollUser;
import java.sql.*;
import java.util.ArrayList;

public class mappingImpl {
	
	
	/**
	 * Sets all PollUser javabean attributes from database (even if empty in database).
	 * 
	 * @param user is PollUser bean
	 */

		
			private static PreparedStatement st;
			private static Connection conn;
			private static ResultSet rs;
				
			public void mapping(String lat, String lng, String pollID){
				
				
				try{
					rs = null;
					conn = new DbConnection().getConn();
					
					System.out.println("*****//RESULTSET NEXT");
					String sql = "UPDATE Poll set Latitude='"+lat+"', Longitude='"+lng+"' WHERE id=(SELECT ID from Poll where Name ='ada')";
					
					
					System.out.println(sql);
					st = conn.prepareStatement(sql);
					
					rs=st.executeQuery();	
					
			    	
			    	
					
				}catch(Exception e){
					e.printStackTrace();
				}
			}
		}